Skip to content

Add custom sidebar content hook#5448

Merged
iBug merged 1 commit intommistakes:masterfrom
bexelbie:pr/sidebar-custom
Mar 9, 2026
Merged

Add custom sidebar content hook#5448
iBug merged 1 commit intommistakes:masterfrom
bexelbie:pr/sidebar-custom

Conversation

@bexelbie
Copy link
Contributor

@bexelbie bexelbie commented Mar 9, 2026

Add {% include sidebar-custom.html %} before the closing </div>
in sidebar.html, with an empty sidebar-custom.html extension
point. This follows the existing pattern of head/custom.html and
author-profile-custom-links.html, letting users inject arbitrary
HTML into the sidebar without overriding the entire sidebar.html
file.

The include renders at the bottom of the sidebar, after the author
profile, YAML-defined sidebar blocks, and navigation menu. The
empty default file ensures existing sites are unaffected.

Documentation updated in the "Custom sidebar content" section of
the layouts docs.

Add {% include sidebar-custom.html %} before the closing </div> in
sidebar.html, with an empty sidebar-custom.html extension point.
Follows the existing pattern of head/custom.html and
author-profile-custom-links.html, letting users inject content
without shadowing the entire sidebar file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bexelbie
Copy link
Contributor Author

bexelbie commented Mar 9, 2026

I use this on my own site to display a "books I am reading" list in the sidebar — see it at bexelbie.com.

@iBug iBug merged commit 0c2eaef into mmistakes:master Mar 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants